//
//  RTMainViewController.swift
//  MevosSwift
//
//  Created by roy on 2017/4/18.
//  Copyright © 2017年 roy. All rights reserved.
//

import UIKit
import SwiftyJSON

class RTMainViewController: BaseViewController,TimerScrollViewDelegate {
    var imgPageView : TimerScrollView!
    override func viewDidLoad() {
        super.viewDidLoad()
        self.TimerScrollView()
        
        let selfRequest = RTViewModel()
        selfRequest.urlRequst(success: { result in
            let json = JSON(result)
            let ary  = json["data"].arrayValue
            print(ary)
            self.imgPageView?.configScrollView(array: ary, contentOffsetIndex: 0)
        }, failture: {error in
            //self.fBlock!(error)
        })
    }
    private func TimerScrollView(){
        imgPageView = TimerScrollView()
        imgPageView?.frame = CGRect(x:0,y:0,width:self.view.frame.size.width,height:100)
        imgPageView?.timeDelegate = self
        self.view.addSubview(imgPageView!)
    }
    func tapActionIndexOfPage(index: Int) {
        
    }
    func scrollToIndexOfPage(index: Int) {
        
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
